package com.lyj.mode.flyWeight;

/**
 * 客户端
 * @author:liyajie
 * @createTime:2022/3/3 11:46
 * @version:1.0
 */
public class Client {
    public static void main(String[] args) {
        //创建一个享元工厂
        WebsiteFactory websiteFactory = new WebsiteFactory();
        Website news = websiteFactory.getWebsite("新闻");
        news.show(new User("老李"));
        Website wechat = websiteFactory.getWebsite("博客");
        wechat.show(new User("老高"));
        websiteFactory.getWebsiteCount();
        Website wechat1 = websiteFactory.getWebsite("微信");
        wechat.show(new User("老沈"));
        websiteFactory.getWebsiteCount();
    }
}
